package meiyunting.shiwuzhaoling.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 链路跟踪可视化控制器
 * 提供页面，用于展示链路跟踪功能
 */
@Slf4j
@Controller
@RequestMapping("/zipkin")
public class ZipkinViewController {

    @Value("${server.port}")
    private String serverPort;
    
    @Value("${spring.zipkin.base-url}")
    private String zipkinUrl;
    
    /**
     * 显示链路跟踪测试页面
     */
    @GetMapping("")
    public String showZipkinPage(Model model) {
        model.addAttribute("currentPort", serverPort);
        model.addAttribute("zipkinUrl", zipkinUrl);
        return "zipkin";
    }
} 